14 research outputs found

    Combining Proofs and Programs in a Dependently Typed Language

    Get PDF
    Most dependently-typed programming languages either require that all expressions terminate (e.g. Coq, Agda, and Epigram), or allow infinite loops but are inconsistent when viewed as logics (e.g. Haskell, ATS, mega). Here, we combine these two approaches into a single dependently-typed core language. The language is composed of two fragments that share a common syntax and overlapping semantics: a logic that guarantees total correctness, and a call-by-value programming language that guarantees type safety but not termination. The two fragments may interact: logical expressions may be used as programs; the logic may soundly reason about potentially nonterminating programs; programs can require logical proofs as arguments; and “mobile” program values, including proofs computed at runtime, may be used as evidence by the logic. This language allows programmers to work with total and partial functions uniformly, providing a smooth path from functional programming to dependently-typed programming. Categories and Subject Descriptors D.3.1 [Programming Languages]: Formal Definitions and Theory Keywords Dependent types; Termination; General recursio

    A Verified LL(1) Parser Generator

    Get PDF
    An LL(1) parser is a recursive descent algorithm that uses a single token of lookahead to build a grammatical derivation for an input sequence. We present an LL(1) parser generator that, when applied to grammar G, produces an LL(1) parser for G if such a parser exists. We use the Coq Proof Assistant to verify that the generator and the parsers that it produces are sound and complete, and that they terminate on all inputs without using fuel parameters. As a case study, we extract the tool\u27s source code and use it to generate a JSON parser. The generated parser runs in linear time; it is two to four times slower than an unverified parser for the same grammar

    Step-Indexed Normalization for a Language with General Recursion

    Get PDF
    The Trellys project has produced several designs for practical dependently typed languages. These languages are broken into two fragments-a_logical_fragment where every term normalizes and which is consistent when interpreted as a logic, and a_programmatic_fragment with general recursion and other convenient but unsound features. In this paper, we present a small example language in this style. Our design allows the programmer to explicitly mention and pass information between the two fragments. We show that this feature substantially complicates the metatheory and present a new technique, combining the traditional Girard-Tait method with step-indexed logical relations, which we use to show normalization for the logical fragment.Comment: In Proceedings MSFP 2012, arXiv:1202.240

    Combining proofs and programs

    Get PDF
    Dependently typed languages allow us to develop programs and write proofs quickly and without errors, and the last decade has seen many success stories for verified programming with dependent types. Despite these successes, dependently typed languages are rarely used for day-to-day programming tasks. There are many reasons why these languages have not been more widely adopted. This thesis addresses two of them: First, existing dependently typed languages restrict recursion and require programmers to prove that every function terminates. Second, traditional representations of equality are inconvenient to work with because they require too much typing information and because their eliminations clutter terms. This thesis introduces PCC&thetas;, a new dependently typed core language that addresses these problems. To handle potentially non-terminating computations, PCC&thetas; is split into two fragments: a programmatic fragment with support for general recursion, and a logical fragment that is restricted for consistency. Crucially, while the logical fragment is consistent, it can reason about programs written in the inconsistent programmatic fragment. To make equality reasoning easier, PCC&thetas; includes a novel heterogeneous notion of equality whose eliminations are not marked in terms. The metatheory of PCC&thetas; is studied in detail, including a complete proof of normalization and consistency for its logical fragment. The normalization proof required the development of a novel technique, partially step-indexed logical relations, which is motivated and explained. Additionally, to demonstrate that PCC&thetas; addresses the problems described above, we have extended it to a complete core language Theta, adding features like user-defined datatypes and an infinite hierarchy of universes. Several examples are carried out in Theta, and an implementation is available

    Arity-Generic Datatype-Generic Programming

    Get PDF
    Some programs are doubly-generic. For example, map is datatypegeneric in that many different data structures support a mapping operation. A generic programming language like Generic Haskell can use a single definition to generate map for each type. However, map is also arity-generic because it belongs to a family of related operations that differ in the number of arguments. For lists, this family includes repeat, map, zipWith, zipWith3, zipWith4, etc. With dependent types or clever programming, one can unify all of these functions together in a single definition. However, no one has explored the combination of these two forms of genericity. These two axes are not orthogonal because the idea of arity appears in Generic Haskell: datatype-generic versions of repeat, map and zipWith have different arities of kind-indexed types. In this paper, we define arity-generic datatype-generic programs by building a framework for Generic Haskell-style generic programming in the dependently-typed programming languag

    The cult of the bound variable: The 9 th annual ICFP programming contest

    No full text
    The annual ICFP Programming Contest has become one of the premiere programming competitions in the world. The 9 th incarnation of the contest, “The Cult of the Bound Variable, ” was held in July 2006 and organized by the Principles of Programming group at Carnegie Mellon University. This report details the contest tasks, the technology used to produce the contest, and the contest results. Several tasks draw ideas from programming languages research. For example, participants implemented a simple virtual machine, played an adventure game based on a substructural logic, and programmed in a two-dimensional circuit language with a discordantly high-level operational semantics. The contest technology includes an optimizing compiler for a high-level functional language that targets our virtual machine. By the end of the three day contest, 365 teams, composed of 700 programmers from all over the world, solved at least one of the contest tasks. c○19106 The Cult of the Bound Variabl

    The Cult of the Bound Variable:

    No full text
    The annual ICFP Programming Contest has become one of the premiere programming competitions in the world. The 9 incarnation of the contest, "The Cult of the Bound Variable," was held in July 2006 and organized by the Principles of Programming group at Carnegie Mellon University. This report details the contest tasks, the technology used to produce the contest, and the contest results. Several tasks draw ideas from programming languages research. For example, participants implemented a simple virtual machine, played an adventure game based on a substructural logic, and programmed in a two-dimensional circuit language with a discordantly high-level operational semantics. The contest technology includes an optimizing compiler for a high-level functional language that targets our virtual machine. By the end of the contest, 365 teams, comprised of 700 programmers from all over the world, solved at least one of the contest tasks

    The Cult of the Bound Variable: The 9th Annual ICFP Programming Contest

    No full text
    The annual ICFP Programming Contest has become one of the premiere programming competitions in the world. The 9th incarnation of the contest, “The Cult of the Bound Variable,” was held in July 2006 and organized by the Principles of Programming group at Carnegie Mellon University. This report details the contest tasks, the technology used to produce the contest, and the contest results. Several tasks draw ideas from programming languages research. For example, participants implemented a simple virtual machine, played an adventure game based on a substructural logic, and programmed in a two-dimensional circuit language with a discordantly high-level operational semantics. The contest technology includes an optimizing compiler for a high-level functional language that targets our virtual machine. By the end of the three day contest, 365 teams, composed of 700 programmers from all over the world, solved at least one of the contest tasks
    corecore